import {posts} from '../assets/server/https'
import {get, post} from '../assets/server/http'

// 获取问卷状态
export function getPaperStatus (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/get_info`
  return get(url, param)
}

// 问卷发布
export function publishQa (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/publish`
  return post(url, param)
}

// 问卷答题结果
export function gainPaperResult (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/question/result`
  return get(url, param)
}

// 删除题目
export function delQuestion (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/question/delete`
  return posts(url, param)
}

// 保存问卷基本信息
export function savePaperBaseInfo (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/saveBaseInfo`
  return posts(url, param)
}

// 修改问卷信息
export function updatePaperInfo (param, id) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/question/update/${id}`
  return posts(url, param)
}

// 问卷添加题目
export function addQues (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/question/add`
  return posts(url, param)
}

// 获取问卷问题列表
export function getPaperQuesList (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/public/get`
  return get(url, param)
}

// 获取问卷题目列表
export function getQuesList (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/question/list`
  return get(url, param)
}

// 问卷暂停
export function pausePaper (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/pause`
  return post(url, param)
}

// 问卷结束
export function stopPaper (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/stop`
  return post(url, param)
}

// 问卷删除
export function delPaper (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/delete`
  return post(url, param)
}

// 获取问卷列表
export function getPaperList (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/list`
  return get(url, param)
}

// 获取问卷的答题记录
export function getPaperReportList (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/report`
  return get(url, param)
}

// 保存问卷配置信息
export function savePaperConfigInfo (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/savePlateType`
  return posts(url, param)
}

// 获取问卷的配置信息
export function getPaperConfigInfo (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/get_info`
  return get(url, param)
}

// 保存问卷配置
export function savePaperConfigParam (param) {
  let url = `${process.env.VUE_APP_SERVICE_SURVEY}/paper/saveSetting`
  return posts(url, param)
}
